<template>
  <div class="builManage">
    <div class="builBox">
      <el-form>
        <el-row class="buil-name">
          <el-col>
            企业名称：<el-input
              size="small"
              placeholder="请输入企业名称"
              style="width: 30%"
            />
            <el-button
              size="small"
              type="primary"
            >查询</el-button>
          </el-col>
        </el-row>
        <el-row>
          <el-col>
            <el-button
              class="add-buil"
              size="small"
              type="primary"
              @click="$router.push('/firmDialog')"
            >添加企业</el-button>
          </el-col>
        </el-row>
        <!-- $企业管理表格 -->
        <el-table
          :data="enterpriseData"
          style="width: 100%"
        >
          <el-table-column type="expand">
            <template slot-scope="props">
              <el-form label-position="left" inline class="demo-table-expand">
                <el-form-item label="租赁楼宇">
                  <span>{{ props.row.name }}</span>
                </el-form-item>
                <el-form-item label="租赁起止时间">
                  <span>{{ props.row.name }}</span>
                </el-form-item>
                <el-form-item label="合同状态">
                  <span>{{ props.row.name }}</span>
                </el-form-item>
                <el-form-item label="操作">
                  <span>{{ props.row.name }}</span>
                </el-form-item>
              </el-form>
            </template>
          </el-table-column>
          <el-table-column
            label="序号"
            prop="id"
            align="center"
            width="100px"
          />
          <el-table-column
            label="企业名称"
            prop="name"
            align="center"
          />
          <el-table-column
            label="联系人"
            prop="contact"
            align="center"
            width="150px"
          />
          <el-table-column
            label="企业联系电话"
            prop="contactNumber"
            align="center"
            width="150px"
          />
          <el-table-column
            label="操作"
            prop="demoFlag"
            align="center"
          >
            <template>
              <el-button type="text">添加合同</el-button>
              <el-button type="text">查看</el-button>
              <el-button type="text">编辑</el-button>
              <el-button type="text">删除</el-button>
            </template>
          </el-table-column>
        </el-table>

      </el-form>
    </div>
    <!-- $ 添加企业弹出框 -->

  </div>
</template>

<script>
import { getEnterprise } from '@/api/parkManage'
export default {
  name: 'FirmManage',
  data() {
    return {
      nameEnterprise: '', // 弹出框名字
      isEnterprise: false, // 弹出框开关
      enterpriseData: [] // 企业列表数据
    }
  },
  created() {
    this.getEnterprise() // 获取企业列表
  },
  methods: {
    async getEnterprise() { // 获取企业列表
      const res = await getEnterprise()
      this.enterpriseData = res.data.rows
    }
  }
}
</script>

<style lang="scss" scoped>
  .builManage {
    .builBox {
      padding: 10px;
      .buil-name {
        padding-bottom: 20px;
        border-bottom: 1px solid rgb(246, 234, 234);
      }
      .add-buil {
        margin-top: 15px;
      }
      .buil-btn {
        margin-left: 30px;
        border-radius: 7px;
      }
      .table-buil {
        height: 100%;
        background-color: aquamarine;
        margin-bottom: 30px;
      }
    }
  }
</style>
